@extends('admin::layouts.master')

@section('content')
    <form action="{{route('category.update',$category['id'])}}" method="post" style="border-radius: 0px;">
        <div class="col-md-12">
            <div class="card card-border-color card-border-color-primary">
                <div class="card-header card-header-divider">
                    分类管理
                    <button type="button" class="btn btn-primary">分类列表</button>
                </div>
                @csrf
                @method('PUT')
                <div class="card-header">
                    <div class="mt-2">
                        <div class="form-group">
                            <label>分类名称</label>
                            <input type="text" value="{{$category['cname']}}" name="cname" class="form-control">
                        </div>
                        <div class="form-group">
                            <label>父级分类</label>
                            <div class="form-group row pt-1">
                                <div class="col-12 col-sm-8 col-lg-12">
                                    <select class="form-control" name="pid">
                                        <option value="0" selected="">顶级分类</option>
                                        @foreach($categorys as $v)
                                            <option value="{{$v['id']}}" {{$v['_selected']?'selected':''}} {{$v['_disabled']?'disabled':''}}>{!! $v['_cname'] !!}</option>
                                        @endforeach
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <button type="submit" class="btn btn-primary btn-lg btn-block">提交</button>
            </div>
        </div>
    </form>
@endsection